﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using DropBoxClient.Entities;
using System.Collections.Generic;

namespace DropBoxClient.Tests
{
    [TestClass]
    public class SearchTest
    {
        private string accessToken;
        private OAuth2Client client;
        private List<Meta> metaList;

        [TestInitialize]
        public void Init()
        {
            accessToken = ConfigurationManager.AppSettings["AccessToken"];
            client = new OAuth2Client(accessToken);
            metaList = client.Search(StringConstants.SandboxRoot, "", ".txt");
        }

        [TestMethod]
        public void Search_ResultIsNotNull()
        {
            Assert.IsNotNull(metaList);
        }

        [TestMethod]
        public void Search_HasEntries()
        {
            Assert.IsTrue(metaList.Count > 0);
        }
    }
}
